package com.whj.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


public class Goods {
    private Integer id;
    private String name;
    private Double price;
    private String img;
    private String specification;
    private Integer number;
    private String unit;
    private String text;

    public Goods() {
    }

    public Goods(Integer id, String name, Double price, String img, String specification, Integer number, String unit, String text) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.img = img;
        this.specification = specification;
        this.number = number;
        this.unit = unit;
        this.text = text;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getImg() {
//        if (this.img != null && this.img.startsWith("/profile/")) {
//            // 将 "/profile" 替换为 "D:\ruoyi"
//            return this.img.replace("/profile", "D:/ruoyi/uploadPath");
//        }
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getSpecification() {
        return specification;
    }

    public void setSpecification(String specification) {
        this.specification = specification;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    @Override
    public String toString() {
        return "Goods{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", img='" + img + '\'' +
                ", specification='" + specification + '\'' +
                ", number=" + number +
                ", unit='" + unit + '\'' +
                ", text='" + text + '\'' +
                '}';
    }
}
